const {parse, format} = require("path");

const filePath = "/a/b/c/d/e/f.js"
let obj = parse(filePath);
console.log(obj);
console.log(format(obj));